//
//  iCamerDevice.h
//  AppControllerDevices
//
//  Created by joker on 15/8/7.
//  Copyright (c) 2015年 joker. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "VideoAndAudioDecoder.h"
/**
 *用于显示解码图像的协议
 *
 */
@protocol iCamerClientDisplayDelegate
/**
 *用于显示解码图像到imageView的代理方法
 *
 *@param    newImage    将要显示的图像
 *
 *@return   void
 */
-(void)updateView:(UIImage *) newImage;

@end


@interface iCamerClient : NSObject

    //MARK: 登录参数
@property NSString* DeviceUID;
@property NSString* UserName;
@property NSString* PassWord;

@property VideoAndAudioDecoder *audioDecoder; //音频解码器对象

@property int AudioOutFormat;  //音频流格式
    //代理对象
@property id<iCamerClientDisplayDelegate> delegate;

/**
 *使用设备UID和设备端口服务帐号与密码登陆设备
 *
 *@param    uid     设备UID
 *
 *@param    name    设备服务端口登陆用户名
 *
 *@param    passwd  设备服务端口登陆密码
 *
 *@return   void
 */
-(void)ConnectDeviceWithUID:(NSString *)uid UserName:(NSString *)name PassWord:(NSString*) passwd;

/**
 *断开与设备的连接
 */
-(void)CancelConnectDevice;


    //MARK: 按照公司文档 《TUTK交互协议说明》功能排序

    //1. 视频观看的开始和停止

/**
 *开始从设备获取视频流
 */
-(void)Video_Start;

/**
 *停止从设备获取视频流
 */
-(void)Video_Stop;


    //2. 音频收听的开始和停止

/**
 *开始从设备获取音频流
 */
-(void)Audio_Start;

/**
 *停止从设备获取音频流
 */
-(void)Audio_Stop;


    //3. 语音对讲的开始和停止

/**
 *开始发送语音到设备
 */
-(void)Speak_Start;

/**
 *停止发送语音到设备
 */
-(void)Speak_Stop;


    //4. 设置设备端音频发送的格式

/**
 *设置设备的音频输出格式
 *
 *@param    format  音频格式设定值(属于枚举量ENUM_CODECID)
 *
 *typedef enum
 *
 *{
 *
 *MEDIA_CODEC_UNKNOWN			= 0x00,
 *
 *MEDIA_CODEC_VIDEO_MPEG4		= 0x4C,
 *
 *MEDIA_CODEC_VIDEO_H263		= 0x4D,
 *
 *MEDIA_CODEC_VIDEO_H264		= 0x4E,
 *
 *MEDIA_CODEC_VIDEO_MJPEG		= 0x4F,
 *
 *MEDIA_CODEC_AUDIO_AAC       = 0x88,
 *
 *MEDIA_CODEC_AUDIO_G711U     = 0x89,
 *
 *MEDIA_CODEC_AUDIO_G711A     = 0x8A,
 *
 *MEDIA_CODEC_AUDIO_ADPCM   = 0X8B,
 *
 *MEDIA_CODEC_AUDIO_PCM        = 0x8C,
 *
 *MEDIA_CODEC_AUDIO_SPEEX		= 0x8D,
 *
 *MEDIA_CODEC_AUDIO_MP3		    = 0x8E,
 *
 *MEDIA_CODEC_AUDIO_G726       = 0x8F,
 *
 *}
 *
 *ENUM_CODECID;
 */
-(void)SetAudioFormat:(int) format;

/**
 *获取设备音频输出格式
 */
-(void)GetAudioOutFormate;


 //5. 视频录制的开始和停止

/**
 *视频录制开始
 */
-(void)Recorder_Start;

/**
 *视频录制结束
 */
-(void)Recorder_Stop;


    //6. 设置视频质量

/**
 *设备视频质量
 *
 *@param    quality 视频质量设定值(枚举量ENUM_QUALITY_LEVEL)
 *
 *
 *typedef enum
 *
 *{
 *
 *AVIOCTRL_QUALITY_UNKNOWN		= 0x00,
 *
 *AVIOCTRL_QUALITY_MAX				= 0x01,	// ex. 640*480, 15fps, 320kbps (or 1280x720, 5fps, 320kbps)
 *
 *AVIOCTRL_QUALITY_HIGH				= 0x02,	// ex. 640*480, 10fps, 256kbps
 *
 *AVIOCTRL_QUALITY_MIDDLE			= 0x03,	// ex. 320*240, 15fps, 256kbps
 *
 *AVIOCTRL_QUALITY_LOW				= 0x04, // ex. 320*240, 10fps, 128kbps
 *
 *AVIOCTRL_QUALITY_MIN                 = 0x05,	// ex. 160*120, 10fps, 64kbps
 *
 *}ENUM_QUALITY_LEVEL;
 *
 */
-(void)SetStreamQuality:(int)quality;

/**
 *获取设备视频质量设定值(摄取机服务端口暂时还没有提供该服务)
 */
-(void)GetStreamQuality;
    //7. 云台控制

/**
 *摄像机云台控制命令发送
 *
 *@param    cmd     PTZ控制命令(枚举量ENUM_PTZCMD)
 *
 * typedef enum
 *
 *{
 *
 *AVIOCTRL_PTZ_STOP					= 0,
 *
 *AVIOCTRL_PTZ_UP                     = 1,
 *
 *AVIOCTRL_PTZ_DOWN				= 2,
 *
 *AVIOCTRL_PTZ_LEFT					= 3,
 *
 *AVIOCTRL_PTZ_LEFT_UP				= 4,
 *
 *AVIOCTRL_PTZ_LEFT_DOWN			= 5,
 *
 *AVIOCTRL_PTZ_RIGHT				= 6,
 *
 *AVIOCTRL_PTZ_RIGHT_UP			= 7,
 *
 *AVIOCTRL_PTZ_RIGHT_DOWN		= 8,
 *
 *AVIOCTRL_PTZ_AUTO				= 9,
 *
 *AVIOCTRL_PTZ_SET_POINT			= 10,
 *
 *AVIOCTRL_PTZ_CLEAR_POINT			= 11,
 *
 *AVIOCTRL_PTZ_GOTO_POINT			= 12,
 *
 *AVIOCTRL_PTZ_SET_MODE_START		= 13,
 *
 *AVIOCTRL_PTZ_SET_MODE_STOP		= 14,
 *
 *AVIOCTRL_PTZ_MODE_RUN			= 15,
 *
 *AVIOCTRL_PTZ_MENU_OPEN			= 16,
 *
 *AVIOCTRL_PTZ_MENU_EXIT			= 17,
 *
 *AVIOCTRL_PTZ_MENU_ENTER		= 18,
 *
 *AVIOCTRL_PTZ_FLIP					= 19,
 *
 *AVIOCTRL_PTZ_START				= 20,
 *
 *AVIOCTRL_LENS_APERTURE_OPEN	= 21,
 *
 *AVIOCTRL_LENS_APERTURE_CLOSE	= 22,
 *
 *AVIOCTRL_LENS_ZOOM_IN			= 23,
 *
 *AVIOCTRL_LENS_ZOOM_OUT			= 24,
 *
 *AVIOCTRL_LENS_FOCAL_NEAR		= 25,
 *
 *AVIOCTRL_LENS_FOCAL_FAR			= 26,
 *
 *AVIOCTRL_AUTO_PAN_SPEED			= 27,
 *
 *AVIOCTRL_AUTO_PAN_LIMIT			= 28,
 *
 *AVIOCTRL_AUTO_PAN_START			= 29,
 *
 *AVIOCTRL_PATTERN_START			= 30,
 *
 *AVIOCTRL_PATTERN_STOP			= 31,
 *
 *AVIOCTRL_PATTERN_RUN				= 32,
 *
 *AVIOCTRL_SET_AUX					= 33,
 *
 *AVIOCTRL_CLEAR_AUX				= 34,
 *
 *AVIOCTRL_MOTOR_RESET_POSITION	= 35,
 *
 *}
 *
 *ENUM_PTZCMD;
 *
 */
-(void)SetPTZMotionWithCommand:(int)cmd;


    //8. LED的开启和关闭

/**
 *打开设备LEO灯
 */
-(void)LED_On;

/**
 *关闭设备LED灯
 */
-(void)LED_Off;


    //9. 报警功能的开启和关闭

/**
 *打开报警功能
 */
-(void)Alarm_On;

/**
 *关闭报警功能
 */
-(void)Alarm_Off;

@end
